package com.websem.client.views;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class SearchResultView extends Composite {

	private static SearchResultViewUiBinder uiBinder = GWT
			.create(SearchResultViewUiBinder.class);

	interface SearchResultViewUiBinder extends
			UiBinder<Widget, SearchResultView> {
	}

	@UiField
	Image posterImage;
	@UiField
	Label filmTitleLabel;
	@UiField
	Label yearLabel;
	@UiField
	Label versionLabel;
	@UiField
	Label actorsLabel;
	@UiField
	Label productorsLabel;
	@UiField
	Label synopsisLabel;
	@UiField
	Label ratingLabel;
	@UiField
	Label durationLabel;
	@UiField
	Label dateLabel;
	@UiField
	Label directorLabel;

	// TODO image a rajouter dans le constructeur
	public SearchResultView(String filmTitle, String filmYear,
			String filmVersion, String actors, String productor, String director, String filmDate, String duration,
			String synoposis, String posterPath, String filmRating) {
		initWidget(uiBinder.createAndBindUi(this));
		System.out.println("------"+posterPath);
		this.filmTitleLabel.setText(filmTitle);
		this.yearLabel.setText(filmYear);
		this.versionLabel.setText(filmVersion);
		this.actorsLabel.setText(actors);
		this.productorsLabel.setText(productor);
		this.synopsisLabel.setText(synoposis);
		this.dateLabel.setText(filmDate);
		this.directorLabel.setText(director);
		this.ratingLabel.setText(filmRating);
		this.durationLabel.setText(duration);
		
		
		// Poster
		this.posterImage.setUrl("images/"+posterPath);
		this.posterImage.setHeight("145 px");
		this.posterImage.setWidth("145px");

	}

	public SearchResultView() {

	}

	public SearchResultView(String firstName) {
		initWidget(uiBinder.createAndBindUi(this));
	}

}
